package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.entity.Student;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Insert("insert into student(id,name,sex,email) values(#{id},#{name},#{sex},#{email})")
    void insert(Student student);
    @Update("update student set name=#{name},sex=#{sex},email=#{email} where id=#{id}")
    void update(Student student);
    @Delete("delete from student where id=#{id}")
    void delete(Integer id);
    @Select("select * from student where id=#{id}")
    Student getById(Integer id);
    @Select("select * from student ")
    List<Student> getAll();

}
